The present invention relates to a preprocessing method to process dither picture data before the process of compression coding, which allows the amount of data to be greatly reduced after the process of compression coding so that picture data transmissions efficiency can be greatly improved.
Picture data is obtained by using an optical element (such as a charge coupled device) to scan the document and then using an analog/digital converter to convert the continuous analog signal thus obtained from the scanning into a continuous binary digital data (1 for white; 0 for black). This process is commonly employed in fax machines. In order to transmit hug picture data rapidly, picture data is commonly compressed to reduce its amount before transmission.
The source of the picture data could be an alphanumeric document, or a picture. The picture data of an alphanumeric document produced through scanning is bi-level data which can be easily processed and compressed by conventional fax machines because conventional fax machines emphasize the processing of alphanumeric documents rather than the processing of pictures, and their default setting is commonly in a black/white thresholded mode. However, a clear result cannot be obtained by using the black/white thresholded mode to process a picture. Therefore, conventional fax machines commonly provide a halftone mode (such as: dither method, error diffusion method, relative density assignment of adjacent pixels--CPIX etc.) to process the picture data of a picture so as to eliminate the aforesaid problem. However, the picture data of a picture obtained through a conventional half-tone mode is not suitable for the processing of compression coding. If the picture has a background color, the frequency of the alternation of block and white dots in the picture data of the picture obtained through either half-tone mode is much higher than that in the picture data of a picture obtained through the black/white thresholded mode. If the picture data is processed by a run length coding, such as the MH (modified huffman) coding method, its compression effect is clearly seen from the following explanation:
1. MH coding uses a horizontal scan line as one coding unit, and coding units are added when scanning from one horizontal scan line to another in the vertical direction until the whole page of the picture has been completely scanned. In the MH coding scheme, as shown in FIG. 1, "white line section run length" indicates the number of continuous white dots; "black line section run length" indicates the number of continuous black dots; and "code value" indicates the corresponding MH coding result.
2. According to the scanning example shown in FIG. 2, using the MH codes of FIG. 1, the original scanned data obtained from an optical scanning element and a digital converter is 01000111 (1 represents a white dot; 0 represents a black dot), and its total amount of data is 8-bits or 15-bits after compression through MH coding.
From the above explanation, the total amount of data is increased after compression through MH coding. This result is apparently against what we expect. Therefore, when a picture of A4 size is processed through dither mode, it takes about 7 minutes (at speed 9600 bps) to complete the transmission, however, it takes only few seconds to complete the transmission of an alphanumeric document of the same size. Therefore, black/white data of 2 bits in the above example will produce a code, 010000111, having a total of 9 bits after coding, namely, the amount of data will be increased by 4.5 times. This defeats the object of using a coding method, which is to compress the data to be transmitted and not to increase it. Either MH, MR or MMR coding method cannot effectively eliminate the aforesaid problem.
Therefore, the half-tone mode of regular fax machines is not set to the receiver's satisfaction, and it produces thicker dots to reduce the possibility of the appearance of a series of alternatively arranged black and white dots so as to improve the compression efficiency. However, when the compression efficiency is improved, the resolution of the picture is relatively reduced. Because of this reason, the half-tone mode of regular fax machines is less practical.
There is known a pattern run length mode commonly used in computers, which inserts a respective mark and a respective pattern into continuous data in front of each of identical data segments. For example: if the data is 010101010101 . . . the pattern can be 55H, and then the number of the pattern 55H in the data may be calculated. This method greatly improves the compression ratio.
There are still other methods disclosed for improving the compression ratio, however, they have in common the following two drawbacks.
1. If the picture has changes in color level, most known methods become ineffective because the picture has low regularity and a complicated mathematical operation must be employed in order to obtain a relatively better result.
2. They are completely different from regular MH, MR, MMR compression methods, and therefore they cannot utilize the advantage and popularity of regular compression coding modes. Therefore, they must define the coding and EOF mark, prevent data from mixing with the control code, decode the posterior data when a row of data in interfered with by noise, and spend much time in improving its applicability in transmission. It is not useful to design a new fax machine coding method if its effect in improving the compression efficiency is not sure.
However, everyone wishes to obtain a fax machine of high receiving resolution, fast transmission speed, super fine mode (300 dpi or 400 dpi), or even a color fax machine. Currently, transmission in telephone lines has been improved from 9600 Baud rate up to 14,400 Baud rate (V. 17). Therefore, there is a heavy demand for a data compression method which allows a fax machine to transmit gray scale or color documents.